from web3 import Web3

url = 'HTTP://127.0.0.1:8545'
hash = '0xc295dd52967ad0a528a5f87f29b13f2a2179443cd62e81b2e0dc94b23866276d'

# 连接到以太坊节点
w3 = Web3(Web3.HTTPProvider(url))

# 确保连接成功
assert w3.is_connected()

# 获取交易
txn_hash = hash
transaction = w3.eth.get_transaction(txn_hash)

# 打印交易详情
print(transaction)
